package logic

import (
	"context"
	"fmt"
	"github.com/zeromicro/go-zero/core/logx"
	"net/http"
	"week1/client/internal/svc"
	"week1/client/internal/types"
)

type CallbackLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

func NewCallbackLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CallbackLogic {
	return &CallbackLogic{
		Logger: logx.WithContext(ctx),
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (l *CallbackLogic) Callback(req *types.CallbackReq) (resp *types.Response, err error) {
	// todo: add your logic here and delete this line
	fmt.Println(req.OrderSn, "回调成功")
	return &types.Response{
		Code:    http.StatusOK,
		Message: "success",
		Data: map[string]interface{}{
			"data": req.OrderSn,
		},
	}, nil
}
